//
//  HMSinaComposeButton.swift
//  ZJCSina
//
//  Created by 朱建超 on 16/11/23.
//  Copyright © 2016年 itHeiMa. All rights reserved.
//

import UIKit

let buttonImageWidth : CGFloat = 80
let buttonHeight : CGFloat = 110

class HMSinaComposeButton: UIButton {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.titleLabel?.textAlignment = .center
        self.titleLabel?.font = UIFont.systemFont(ofSize: 15)
    
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //返回titleLabel的frame
    override func titleRect(forContentRect contentRect: CGRect) -> CGRect {
        
        return CGRect(x: 0, y: buttonImageWidth, width: buttonImageWidth, height: buttonHeight - buttonImageWidth)
        
    }
    
    //返回imageView的frame
    override func imageRect(forContentRect contentRect: CGRect) -> CGRect {
        
        return CGRect(x: 0, y: 0, width: buttonImageWidth, height: buttonImageWidth)
        
    }

}
